/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:49:44
 *
 * 题库有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */
import { createAPI } from '@/utils/request'

// 组题列表 ---- 获取组题列表详情
export const getRandoms = data => createAPI('/questions/randoms/', 'get', data)
// 组题列表 --- 题组删除接口
export const delRandoms = data => createAPI(`/questions/randoms/${data.id}`, 'DELETE', data)
// 基础题库预览
export const getPreview = data => createAPI(`/questions/${data.id}`, 'get', data)
// 题库列表
export const list = data => createAPI('/questions/', 'get', data)
// 修改
export const update = id => createAPI(`/questions/${id}`, 'put')
// 添加
export const add = data => createAPI('/questions', 'post', data)
// 删除
export const del = id => createAPI(`/questions/${id}`, 'delete')
// 详情
export const detail = data => createAPI(`/questions/${data.id}`, 'get', data)
// 加入或移出精选
export const change = (id, choiceState) => createAPI(`/questions/choice/${id}/${choiceState}`, 'patch')
// 获取学科简单列表
export const subjectList = data => createAPI('/subjects/simple', 'get', data)
// 标签简单列表
export const tagsList = data => createAPI('/tags', 'get', data)
// 录入人列表
export const creatorsList = data => createAPI('/users/', 'get', data)
// 目录列表
export const direcotrys = data => createAPI('/directorys', 'get', data)

// 玉君，通写试题录入页面，封装接口

// 学科请求
export const SubjectList = data => createAPI('/subjects/simple', 'get', data)

// 企业请求
export const CompanysList = data => createAPI('/companys?pagesize=10000', 'get', data)

// 学科下的分类请求
export const Subjectcatalogue = data => createAPI(`/directorys/simple?subjectID=${data}`, 'get')
// 学科下的另一个分类请求
export const SubjectTestQuestionLabel = data => createAPI(`/tags/simple?subjectID=${data}`, 'get')
// 表单提交发起请求
export const FormSubmission = data => createAPI('/questions', 'POST', data)
// 回写发起请求
export const WriteBack = data => createAPI('/questions/23?id=23', 'get', data)
